<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<JugglingMvc.Helpers.PaginatedList<Juggler>>" %>
<table>
    <tr>
        <th>
        </th>
        <th>
            Id
        </th>
        <th>
            Name
        </th>
        <th>
            Specialty
        </th>
        <th>
            WebPage
        </th>
        <th>
            BornDay
        </th>
        <th>
            Team
        </th>
       
        <th>
         </th>
    </tr>
    <% foreach (var juggler in Model)
       { %>
    <tr>
        <td>
            <%= Html.ActionLink("Edit", "Edit", new { id=juggler.Id }) %>
            |
            <%= Html.ActionLink("Details", "Details", new { id=juggler.Id })%>
        </td>
        <td>
            <%= Html.Encode(juggler.Id) %>
        </td>
        <td>
            <%= Html.ActionLink(juggler.Name, "Details", new { id=juggler.Id }) %>
        </td>
        <td>
            <%= Html.Encode(juggler.Specialty.Name) %>
        </td>
        <td>
            
            <a href="<%= juggler.WebPage %>">
                <%= juggler.WebPage %>
            </a>
            
           
        </td>
        <td>
            <%=  juggler.BornDay.HasValue? String.Format("{0:g}", juggler.BornDay.Value.ToShortDateString()):""%>
        </td>
        <td>
            <%=juggler.TeamId.HasValue? juggler.Team.Name:"None"%>
        </td>
        <td>
            <%= Html.ActionLink("Delete", "Delete", new { id = juggler.Id })%>
        </td>
    </tr>
    <% } %>
</table>
<% if (Model.HasPreviousPage)
   { %>
<%= Ajax.RouteLink("<<<", "Jugglers", new { page=(Model.PageIndex-1) }, new AjaxOptions { HttpMethod = "GET", InsertionMode = InsertionMode.Replace, UpdateTargetId = "jugglers-list" }) %>
<% } %>
<% if (Model.HasNextPage)
   { %>
<%= Ajax.RouteLink(">>>", "Jugglers", new { page=(Model.PageIndex+1) }, new AjaxOptions { HttpMethod = "GET", InsertionMode = InsertionMode.Replace, UpdateTargetId = "jugglers-list" }) %>
<% } %>